<?php defined('SYSPATH') or die('No direct script access.');

/**
 * 例子控制器
 */
class Controller_Index extends Stourweb_Controller
{
    /**
     * 初始化支付对象
     */
    public function before()
    {
        parent::before();
    }
    public function action_index()
    {
       $this->request->redirect('pc');
    }


    public function action_dialog_setstartplace()
    {
        $id = $this->params['id'];
        $startplacetop = DB::select()->from('startplace')->where('pid', '=', 0)->and_where('isopen','=',1)->execute()->as_array();
        $startplacelist = DB::select()->from('startplace')->where('pid', '!=', 0)->and_where('isopen','=',1)->execute()->as_array();
        foreach ($startplacetop as &$item)
        {
            $pid=$item['id'];
            $item['num'] = DB::query(Database::SELECT,"select count(*) as num from sline_startplace where pid='{$pid}' and isopen=1 ")->execute()->get('num');
        }
        $this->assign('startplacetop', $startplacetop);
        $this->assign('startplacelist', $startplacelist);
        $this->assign('startplaceid', $id);
        $this->display('dialog_setstartplace');
    }

    public function action_ajax_get_start_place()
    {
        $id = intval($_REQUEST['pid']);
        $keyword = trim(Arr::get($_POST, 'keyword'));
        $sql="SELECT * FROM sline_startplace";
        $where=" WHERE isopen=1";
        if($id)
        {
            $where.=" AND pid={$id}";
        }
        if($keyword)
        {
            $keyword_str='%'.$keyword.'%';
            $where.=" AND cityname like '{$keyword_str}'";
        }
        $sql.=$where;
        $startplace=DB::query(Database::SELECT,$sql)->execute()->as_array();
        echo json_encode(array('status' => $startplace?true:false, 'msg' => 'ok', 'list' => $startplace,'count'=>count($startplace)));
    }

    /**
     * 综合数据报表
     * @throws View_Exception
     */
    public function action_data()
    {
        $sid = Cookie::get('st_supplier_id');
        if(!empty($sid))
        {
            $this->_user_info = Model_Supplier::get_supplier_byid($sid);
            $this->assign('userinfo',$this->_user_info);
        }else
        {
            $this->request->redirect($GLOBALS['cfg_basehost'].'/plugins/supplier/pc/login');
        }
        //缺省条件
        $default_search = array(
            "type"=>'year',
            "year"=>date("Y"),
            "proType"=>0,
            'proSingle'=>0
        );
        //获取搜索条件
        $search = Arr::get($_POST,'searchjson',json_encode($default_search));
        $search = json_decode($search,true);
        //print_r($search);
        $type       = $search['type'];
        $year       = $search['year'];
        $month      = $search['month'];
        $pro_type   = $search['proType'];
        $pro_sin    = $search['proSingle'];
        $pro_id     = $search['proId'];
        $datalist   = array();
        $datachannel= array();
        //判断安装美团门票接口没有
        $ismeituan = St_Functions::is_normal_app_install('supplier_meituan_ticket');
        //CMS产品检索条件支持
        $supplier_where = " and a.supplierlist = ".$sid." "; //供应商过滤
        $pro_where      = '';//产品过滤
        if($pro_type){
            $pro_where .= " and a.typeid=".$pro_type." ";
        }
        if($pro_sin==1 && $pro_id)
        {
            //$pro_where .= " and a.productautoid=".$pro_id." ";
            $pro_where .= " and a.suitid=".$pro_id." ";
        }
        //美团产品检索条件支持
        $supplier_meituan_where = " and a.supplierid = ".$sid." "; //供应商过滤
        $pro_meituan_where      = '';//产品过滤
        //只有门票+全部产品类型才有效
        if($pro_type==0 || $pro_type==5)
        {
            if($pro_sin==1 && $pro_id)
            {
                $pro_meituan_where .= " and a.partnerDealId=".$pro_id." ";
            }
        }else
        {
            $pro_meituan_where .= " and 1=2 ";
        }

        //按年查询
        //+----------------------------------------------
        if($type=='year' || !$month)
        {
            //统计维度（1-12月）
            $months = array();
            for($i=1;$i<13;$i++)
            {
                $start    = strtotime($year.'-'.$i.'-01');
                $end      = strtotime($year.'-'.$i.'-01 +1 month -1 day');
                $months[] = array('s'=>$start,'e'=>$end);
            }
            //cms销量总数(订单数)
            $cms_total_num      = 0;
            $cms_total_money    = 0;
            $meituan_total_num  = 0;
            $meituan_total_money= 0;
            //逐月统计数据
            foreach ($months as $item)
            {
                $start = $item['s'];
                $end   = $item['e']+(24*3600-1);
                $temp  = array();
                $temp['key']    = date("m月",$start);

                //消费数量（总人群数量）
                //CMS
                $sql  = "select sum(dingnum+childnum+oldnum+people4_num+people5_num+people6_num) as nums from sline_member_order as a where `status`=5 and `addtime` between {$start} and {$end} ";
                $sql .= $supplier_where;
                $sql .= $pro_where;
                $res = DB::query(Database::SELECT, $sql)->execute()->current();
                $usenum = $res['nums'] ? $res['nums'] : 0;
                //美团
                if($ismeituan){
                    $sql  = " select sum(quantity) as nums ";
                    $sql .= " from sline_spot_meituan_ticket_order as a ";
                    $sql .= " where a.`status`=5 and a.`create_time` between {$start} and {$end} ";
                    $sql .= $supplier_meituan_where;
                    $sql .= $pro_meituan_where;
                    $res = DB::query(Database::SELECT, $sql)->execute()->current();
                    //echo $sql;
                    //print_r($res);
                    $usenum = $usenum + ($res['nums'] ? $res['nums'] : 0);
                }
                $temp['usenum'] = $usenum;


                //支付数量(订单)
                //CMS
                $sql = "select count(*) as nums from sline_member_order as a where (a.`status`=2 or a.`status`=5)  and `addtime` between {$start} and {$end} ";
                $sql .= $supplier_where;
                $sql .= $pro_where;
                $res = DB::query(Database::SELECT, $sql)->execute()->current();
                //print_r($res);
                $paynum = $res['nums'] ? $res['nums'] : 0;
                $cms_total_num  = $cms_total_num + $res['nums'];
                //美团
                if($ismeituan){
                    $sql  = " select count(*) as nums ";
                    $sql .= " from sline_spot_meituan_ticket_order as a ";
                    $sql .= " where (a.`status`=2 or a.`status`=5) and a.`create_time` between {$start} and {$end} ";
                    $sql .= $supplier_meituan_where;
                    $sql .= $pro_meituan_where;
                    $res  = DB::query(Database::SELECT, $sql)->execute()->current();
                    $meituan_total_num = $meituan_total_num + $res['nums'];
                    $paynum = $paynum + ($res['nums'] ? $res['nums'] : 0);
                }
                $temp['paynum'] = $paynum;



                //订单金额
                //cms
                $sql  = " select sum(b.total_price) as total_money ";
                $sql .= " from sline_member_order as a left join sline_member_order_compute as b on a.id=b.order_id";
                $sql .= " where (a.`status`=2 or a.`status`=5) and a.`addtime` between {$start} and {$end} ".$supplier_where;
                $sql .= $supplier_where;
                $sql .= $pro_where;
                $res = DB::query(Database::SELECT, $sql)->execute()->current();
                $billmoney = $res['total_money'] ? $res['total_money'] : 0;
                $cms_total_money   = $cms_total_money + $res['total_money'];
                //美团
                if($ismeituan){
                    $sql  = " select sum(a.totalPrice) as total_money ";
                    $sql .= " from sline_spot_meituan_ticket_order as a ";
                    $sql .= " where (a.`status`=2 or a.`status`=5) and a.`create_time` between {$start} and {$end} ";
                    $sql .= $supplier_meituan_where;
                    $sql .= $pro_meituan_where;
                    $res  = DB::query(Database::SELECT, $sql)->execute()->current();
                    $meituan_total_money = $meituan_total_money + $res['total_money'];
                    $billmoney = $billmoney + ($res['total_money'] ? $res['total_money'] : 0);
                }

                $temp['billmoney'] = $billmoney;




                //收益金额(已结算)
                //cms
                $sql  = " select sum(b.finish_brokerage) as total_money ";
                $sql .= " from sline_member_order as a left join sline_supplier_brokerage as b on a.ordersn=b.ordersn";
                $sql .= " where b.`status`=2 and a.`addtime` between {$start} and {$end} ".$supplier_where;
                $sql .= $supplier_where;
                $sql .= $pro_where;
                $res = DB::query(Database::SELECT, $sql)->execute()->current();
                $inmoney = $res['total_money'] ? $res['total_money'] : 0;
                //美团
                if($ismeituan)
                {
                    $sql  = " select sum(buyPrice*quantity) as total_money ";
                    $sql .= " from sline_spot_meituan_ticket_order as a ";
                    $sql .= " where (a.`status`=2 or a.`status`=5) and a.`create_time` between {$start} and {$end} ";
                    $sql .= $supplier_meituan_where;
                    $sql .= $pro_meituan_where;
                    $res  = DB::query(Database::SELECT, $sql)->execute()->current();
                    //echo $sql;
                    //print_r($res);
                    $inmoney = $inmoney + ($res['total_money'] ? $res['total_money'] : 0);
                }
                $temp['inmoney'] = $inmoney;

                $datalist[] = $temp;
            }
            //print_r($datalist);

            $datachannel['cms']['nums']    = $cms_total_num;
            $datachannel['cms']['money']   = $cms_total_money;
            //美团渠道统计数据（美团门票）
            if($ismeituan){
                $datachannel['meituan']['nums']   = $meituan_total_num;
                $datachannel['meituan']['money'] = $meituan_total_money;
            }
        }
        //+逐月统计完毕
        //+----------------------------------------------
        //+逐日统计开始
        if($type=='month' && $month)
        {
            //统计维度（月/逐日统计）
            $starttime    = strtotime($year.'-'.$month.'-01');
            $endtime      = strtotime($year.'-'.$month.'-01 +1 month -1 day');
            $steptime = 24*3600;
            for($day=$starttime;$day<=$endtime;$day+=$steptime)
            {
                $temp = array();
                $temp['key'] = date("d日",$day);
                //逐日查询统计
                $start = $day;
                $end   = $day+($steptime-1);
                //消费数量（总人群数量）
                //CMS
                $sql  = "select sum(dingnum+childnum+oldnum+people4_num+people5_num+people6_num) as nums from sline_member_order as a where `status`=5 and `addtime` between {$start} and {$end} ";
                $sql .= $supplier_where;
                $sql .= $pro_where;
                $res = DB::query(Database::SELECT, $sql)->execute()->current();
                $usenum = $res['nums'] ? $res['nums'] : 0;
                //美团
                if($ismeituan){
                    $sql  = " select sum(quantity) as nums ";
                    $sql .= " from sline_spot_meituan_ticket_order as a ";
                    $sql .= " where a.`status`=5 and a.`create_time` between {$start} and {$end} ";
                    $sql .= $supplier_meituan_where;
                    $sql .= $pro_meituan_where;
                    $res = DB::query(Database::SELECT, $sql)->execute()->current();
                    //echo $sql;
                    //print_r($res);
                    $usenum = $usenum + ($res['nums'] ? $res['nums'] : 0);
                }
                $temp['usenum'] = $usenum;
                //支付数量(订单)
                //CMS
                $sql = "select count(*) as nums from sline_member_order as a where (a.`status`=2 or a.`status`=5)  and `addtime` between {$start} and {$end} ";
                $sql .= $supplier_where;
                $sql .= $pro_where;
                $res = DB::query(Database::SELECT, $sql)->execute()->current();
                //print_r($res);
                $paynum = $res['nums'] ? $res['nums'] : 0;
                $cms_total_num  = $cms_total_num + $res['nums'];
                //美团
                if($ismeituan){
                    $sql  = " select count(*) as nums ";
                    $sql .= " from sline_spot_meituan_ticket_order as a ";
                    $sql .= " where (a.`status`=2 or a.`status`=5) and a.`create_time` between {$start} and {$end} ";
                    $sql .= $supplier_meituan_where;
                    $sql .= $pro_meituan_where;
                    $res  = DB::query(Database::SELECT, $sql)->execute()->current();
                    $meituan_total_num = $meituan_total_num + $res['nums'];
                    $paynum = $paynum + ($res['nums'] ? $res['nums'] : 0);
                }
                $temp['paynum'] = $paynum;
                //订单金额
                //cms
                $sql  = " select sum(b.total_price) as total_money ";
                $sql .= " from sline_member_order as a left join sline_member_order_compute as b on a.id=b.order_id";
                $sql .= " where (a.`status`=2 or a.`status`=5) and a.`addtime` between {$start} and {$end} ".$supplier_where;
                $sql .= $supplier_where;
                $sql .= $pro_where;
                $res = DB::query(Database::SELECT, $sql)->execute()->current();
                $billmoney = $res['total_money'] ? $res['total_money'] : 0;
                $cms_total_money   = $cms_total_money + $res['total_money'];
                //美团
                if($ismeituan){
                    $sql  = " select sum(a.totalPrice) as total_money ";
                    $sql .= " from sline_spot_meituan_ticket_order as a ";
                    $sql .= " where (a.`status`=2 or a.`status`=5) and a.`create_time` between {$start} and {$end} ";
                    $sql .= $supplier_meituan_where;
                    $sql .= $pro_meituan_where;
                    $res  = DB::query(Database::SELECT, $sql)->execute()->current();
                    $meituan_total_money = $meituan_total_money + $res['total_money'];
                    $billmoney = $billmoney + ($res['total_money'] ? $res['total_money'] : 0);
                }
                $temp['billmoney'] = $billmoney;

                //收益金额(已结算)
                //cms
                $sql  = " select sum(b.finish_brokerage) as total_money ";
                $sql .= " from sline_member_order as a left join sline_supplier_brokerage as b on a.ordersn=b.ordersn";
                $sql .= " where b.`status`=2 and a.`addtime` between {$start} and {$end} ".$supplier_where;
                $sql .= $supplier_where;
                $sql .= $pro_where;
                $res = DB::query(Database::SELECT, $sql)->execute()->current();
                $inmoney = $res['total_money'] ? $res['total_money'] : 0;
                //美团
                if($ismeituan)
                {
                    $sql  = " select sum(buyPrice*quantity) as total_money ";
                    $sql .= " from sline_spot_meituan_ticket_order as a ";
                    $sql .= " where (a.`status`=2 or a.`status`=5) and a.`create_time` between {$start} and {$end} ";
                    $sql .= $supplier_meituan_where;
                    $sql .= $pro_meituan_where;
                    $res  = DB::query(Database::SELECT, $sql)->execute()->current();
                    //echo $sql;
                    //print_r($res);
                    $inmoney = $inmoney + ($res['total_money'] ? $res['total_money'] : 0);
                }
                $temp['inmoney'] = $inmoney;
                //echo date("Y-m-d H:i:s",$start);
                //echo '|'.date("Y-m-d H:i:s",$end);
                //echo '<hr>'."\n";
                $datalist[]  = $temp;
            }

            $datachannel['cms']['nums']    = $cms_total_num;
            $datachannel['cms']['money']   = $cms_total_money;
            //美团渠道统计数据（美团门票）
            if($ismeituan){
                $datachannel['meituan']['nums']   = $meituan_total_num;
                $datachannel['meituan']['money'] = $meituan_total_money;
            }
        }

        //print_r($datalist);
        //print_r($datachannel);
        $this->assign('search',$search);
        $this->assign('data',$datalist);
        $this->assign('channel',$datachannel);
        $this->display('data');
    }
    //产品查询
    public function action_data_single()
    {
        $type       = Arr::get($_GET,'type','');
        $page       = Arr::get($_GET,'page',1);
        $page_size  = 10;
        $keyword    = Arr::get($_GET,'keyword','');

        //根据不同类型组合不同sql查询
        $select    = " select ";
        $fields    = " a.id,a.title ";
        $where     = '';
        $orderby   = ' order by a.id desc ';
        //线路
        if($type==1){
            $fields  = " b.id,CONCAT(a.title,'[',b.suitname,']') as title,'-' as fstr ";
            $from    = " from sline_line as a ";
            $from   .= " inner join sline_line_suit as b on a.id=b.lineid ";
            if($keyword)
            {
                $where  = " where a.title like '%".$keyword."%' ";
            }
        }
        //酒店
        if($type==2){
            $fields  = " b.id,CONCAT(a.title,'[',b.roomname,']') as title,b.api_user as fstr ";
            $from    = " from sline_hotel as a ";
            $from   .= " inner join sline_hotel_room as b on a.id=b.hotelid ";
            if($keyword)
            {
                $where  = " where (a.title like '%".$keyword."%' or b.roomname like '%".$keyword."%') ";
            }
        }
        //门票
        if($type==5){
            $fields  = " b.id,CONCAT(a.title,'[',b.title,']') as title,c.title as fstr ";
            $from    = " from sline_spot as a ";
            $from   .= " inner join sline_spot_ticket as b on a.id=b.spotid ";
            $from   .= " left join sline_spot_ticket_interface as c on c.id=b.create_type ";
            if($keyword)
            {
                $where  = " where (b.title like '%".$keyword."%') ";
            }
        }

        $limit = " limit ".($page-1)*$page_size.",".$page_size;
        //取得总记录数
        $sql   = $select." count(*) as num ".$from.$where.$orderby;
        $total_nums = DB::query(Database::SELECT,$sql)->execute()->get('num');
        //取得列表数据
        $sql = $select.$fields.$from.$where.$orderby.$limit;
        //echo $sql;
        $lists      = DB::query(Database::SELECT,$sql)->execute()->as_array();
        //print_r($lists);
        //print_r($total_nums);

        $return = array('status'=>1,'page_nums'=>ceil($total_nums/$page_size),'data'=>$lists);
        echo json_encode($return);
        //echo $type;
    }


    //cms分销主框架
    public function action_cms()
    {
        $sid = Cookie::get('st_supplier_id');
        if(!empty($sid))
        {
            $this->_user_info = Model_Supplier::get_supplier_byid($sid);
            $this->assign('userinfo',$this->_user_info);
        }else
        {
            $this->request->redirect($GLOBALS['cfg_basehost'].'/plugins/supplier/pc/login');
        }
        //默认订单页面
        $user_m_kind = ($this->_user_info['verifystatus'] == 3 ? explode(',', $this->_user_info['authorization']) : array());

        $line_product = file_exists(PLUGINPATH.'supplier_line') && in_array(1,$user_m_kind) && St_Functions::is_normal_app_install('supplierlinemanage') ? 1: 0;
        $hotel_product = file_exists(PLUGINPATH.'supplier_hotel') && in_array(2,$user_m_kind)&& St_Functions::is_normal_app_install('supplierhotelmanage') ? 1 : 0;
        $car_product = file_exists(PLUGINPATH.'supplier_car') && in_array(3,$user_m_kind)&& St_Functions::is_normal_app_install('suppliercarmanage') ? 1 : 0;
        $tuan_product = file_exists(PLUGINPATH.'supplier_tuan') && in_array(13,$user_m_kind) && St_Functions::is_normal_app_install('suppliertuanmanage')? 1 : 0;
        $spot_product = file_exists(PLUGINPATH.'supplier_spot') && in_array(5,$user_m_kind) && St_Functions::is_normal_app_install('supplierspotmanage')? 1 : 0;
        $outdoor_product = file_exists(PLUGINPATH.'supplier_outdoor') && in_array(114,$user_m_kind) && St_Functions::is_normal_app_install('supplieroutdoormanage')? 1 : 0;
        $techan_product = file_exists(PLUGINPATH.'supplier_techan') && in_array(118,$user_m_kind) && St_Functions::is_normal_app_install('suppliertechanmanage')? 1 : 0;
        $food_product = file_exists(PLUGINPATH.'supplier_food') && in_array(121,$user_m_kind) && St_Functions::is_normal_app_install('supplierfoodmanage') ? 1: 0;
        $check_product = file_exists(PLUGINPATH.'supplier_check') && St_Functions::is_normal_app_install('supplierverifyorder') ? 1 : 0;
        $finance_manage = file_exists(PLUGINPATH.'supplier_finance') && St_Functions::is_normal_app_install('supplierfinancemanage')? 1 : 0;

        $has_tongyong=false;
        foreach ($user_m_kind as $k1=>$v1) {
            if($v1>199){
                $has_tongyong=true;
            }
        }

        if($line_product || $hotel_product || $car_product || $tuan_product || $spot_product || $outdoor_product || $techan_product || $food_product||$has_tongyong)
        {
            $is_pro = true;
        }else{
            $is_pro = false;
        }
        $this->assign('is_pro',$is_pro);
        $this->assign('check_product',$check_product);
        $this->assign('finance_manage',$finance_manage);
        $this->display('cms/index');
    }
    //cms产品tab分销框架
    public function action_cms_list()
    {
        $sid = Cookie::get('st_supplier_id');
        if(!empty($sid))
        {
            $this->_user_info = Model_Supplier::get_supplier_byid($sid);
            $this->assign('userinfo',$this->_user_info);
        }
        //print_r($this->_user_info);
        //默认订单页面
        $user_m_kind = ($this->_user_info['verifystatus'] == 3 ? explode(',', $this->_user_info['authorization']) : array());

        $line_product = file_exists(PLUGINPATH.'supplier_line') && in_array(1,$user_m_kind) && St_Functions::is_normal_app_install('supplierlinemanage') ? 1: 0;
        $hotel_product = file_exists(PLUGINPATH.'supplier_hotel') && in_array(2,$user_m_kind)&& St_Functions::is_normal_app_install('supplierhotelmanage') ? 1 : 0;
        $car_product = file_exists(PLUGINPATH.'supplier_car') && in_array(3,$user_m_kind)&& St_Functions::is_normal_app_install('suppliercarmanage') ? 1 : 0;
        $tuan_product = file_exists(PLUGINPATH.'supplier_tuan') && in_array(13,$user_m_kind) && St_Functions::is_normal_app_install('suppliertuanmanage')? 1 : 0;
        $spot_product = file_exists(PLUGINPATH.'supplier_spot') && in_array(5,$user_m_kind) && St_Functions::is_normal_app_install('supplierspotmanage')? 1 : 0;
        $outdoor_product = file_exists(PLUGINPATH.'supplier_outdoor') && in_array(114,$user_m_kind) && St_Functions::is_normal_app_install('supplieroutdoormanage')? 1 : 0;
        $tongyong_product = file_exists(PLUGINPATH.'supplier_tongyong') && St_Functions::is_normal_app_install('suppliercommonmanage')? 1 : 0;
        $techan_product = file_exists(PLUGINPATH.'supplier_techan') && in_array(118,$user_m_kind) && St_Functions::is_normal_app_install('suppliertechanmanage')? 1 : 0;
        $food_product = file_exists(PLUGINPATH.'supplier_food') && in_array(121,$user_m_kind) && St_Functions::is_normal_app_install('supplierfoodmanage') ? 1: 0;
        $meituan_ticket = file_exists(PLUGINPATH.'supplier_meituan_ticket') && St_Functions::is_normal_app_install('supplier_meituan_ticket')? 1 : 0;

        //echo $techan_product = 1;
        //echo $line_product;

        if($tongyong_product)
        {
            $ty_list = Model_Model::tongyoug_model();
            $tongyong_list = array();
            foreach($ty_list as $tongyong)
            {
                if (in_array($tongyong['id'], $user_m_kind))
                {
                    array_push($tongyong_list,$tongyong);
                }
            }
            $this->assign('tongyong_list',$tongyong_list);
        }


        if($line_product || $hotel_product || $car_product || $tuan_product || $spot_product || $outdoor_product || $techan_product || $food_product)
        {
            $is_pro = true;
        }else{
            $is_pro = false;
        }
        $this->assign('is_pro',$is_pro);
        $this->assign('line_product',$line_product);
        $this->assign('hotel_product',$hotel_product);
        $this->assign('car_product',$car_product);
        $this->assign('spot_product',$spot_product);
        $this->assign('tuan_product',$tuan_product);
        $this->assign('tongyong_product',$tongyong_product);
        $this->assign('outdoor_product',$outdoor_product);
        $this->assign('techan_product',$techan_product);
        $this->assign('food_product',$food_product);
        $this->assign('meituan_ticket',$meituan_ticket);

        $this->display('cms/list');
    }

    //旅游村框架
    public function action_lyc()
    {
        $this->display('lyc');
    }
    //验单框架
    public function action_check_list()
    {
        $this->display('cms/checklist');
    }
    //财务框架
    public function action_brokerage_list()
    {
        $this->display('cms/brokeragelist');
    }
    //线路分销列表
    public function action_cms_line()
    {
        $this->request->redirect($GLOBALS['cfg_basehost'].'/plugins/supplier_line/index/suit?mode=sale');
    }
    //酒店分销列表
    public function action_cms_hotel()
    {
        $this->request->redirect($GLOBALS['cfg_basehost'].'/plugins/supplier_hotel/index/list?templet=suit_list&mode=sale');
    }
    //门票分销列表
    public function action_cms_spot()
    {
        $this->request->redirect($GLOBALS['cfg_basehost'].'/plugins/supplier_spot/?mode=sale');
    }
    //租车分销列表
    public function action_cms_car()
    {
        $this->request->redirect($GLOBALS['cfg_basehost'].'/plugins/supplier_car/index/suit_list?mode=sale');
    }
    //团购分销列表
    public function action_cms_tuan()
    {
        $this->request->redirect($GLOBALS['cfg_basehost'].'/plugins/supplier_tuan/index/list?mode=sale');
    }
    //户外分销列表
    public function action_cms_outdoor()
    {
        $this->request->redirect($GLOBALS['cfg_basehost'].'/plugins/supplier/outdoor/index/suit?mode=sale');
    }
    //户外分销列表
    public function action_cms_food()
    {
        $this->request->redirect($GLOBALS['cfg_basehost'].'/plugins/supplier/food/index/suit?mode=sale');
    }
    //特产分销列表
    public function action_cms_techan()
    {
        $this->request->redirect($GLOBALS['cfg_basehost'].'/plugins/supplier_techan/index/list/typeid/118?templet=suit_list&mode=sale');
    }

    //通用分销列表
    public function action_cms_tongyong()
    {
        $typeid = Arr::get($_GET,'typeid','');
        //echo $typeid;
        //print_r($_GET);/plugins/supplier_tongyong/index/list/typeid/239?templet=suit_list
        $this->request->redirect($GLOBALS['cfg_basehost'].'/plugins/supplier_tongyong/index/list/typeid/'.$typeid.'?templet=suit_list&mode=sale&typeid='.$typeid);
    }
    //验单新页面
    public function action_menu_check()
    {
        $this->display('cms/check');
    }





}